export default detail => {
	if (detail?.taskId) {
		if (detail?.taskCategory === 'hostVul') {
			return `/job-manage/host-task?tid=${detail?.taskId}`;
		} else if (detail?.taskCategory === 'aviliable') {
			if (detail?.triggerType) {
				return `/job-manage/aviliable-task/detail?id=${detail?.asset_task_id}&type=${detail?.triggerType}&jid=${detail?.jobId}`;
			} else {
				return `/job-manage/aviliable-task?filter=${encodeURI(
					JSON.stringify({
						target: detail?.target,
						task_group_type: detail?.taskType,
					})
				)}`;
			}
		} else if (
			['content', 'vul', 'ssl', 'securityEvent', 'changeCheck'].includes(detail?.taskType)
		) {
			if (detail?.triggerType) {
				let taskType = detail?.taskType
				if (detail?.taskType === "securityEvent") {
					taskType = "security_event";
				} else if (detail?.taskType === "changeCheck") {
					taskType = "change_check";
				}
				if (
					detail?.triggerType === 'schedule' ||
					detail?.triggerType === 'scheduleIncrement'
				) {
					return `/job-manage/web-task/history?asset_task_id=${detail?.asset_task_id}&task_id=${detail?.taskId}&task_types=${taskType}&last=last`;
				} else {
					return `/job-manage/web-task/detail?id=${detail?.asset_task_id}&type=${detail?.triggerType}&jid=${detail?.jobId}&tag=${taskType}`;
				}
			} else {
				return `/job-manage/web-task?filter=${encodeURI(
					JSON.stringify({ target_url: detail?.target })
				)}`;
			}
		} else {
			if (detail?.triggerType) {
				return {
					pathname: '/asset-manage/manage/web/Detail',
					search: `jid=${detail?.jobId}&url=${detail?.target}&task_id=${detail.taskId}&TabsKey=asset`,
				};
			} else {
				return `/asset-manage/manage/web?filter=${encodeURI(
					JSON.stringify({ target_url: detail?.target, asset_type: 'web' })
				)}`;
			}
		}
	}
};
